package com.my.cd.observe;

/**
 * 主测试类
 */
public class MainTest {

    public static void main(String[] args) {

        CurrentConditions mCurrentConditions;
        ForcastConditions mForcastConditions;
        WeatherDataSubject mWeatherDataSubject;

        mWeatherDataSubject = new WeatherDataSubject();
        mCurrentConditions = new CurrentConditions();
        mForcastConditions = new ForcastConditions();

        mWeatherDataSubject.registerObserver(mCurrentConditions);
        mWeatherDataSubject.registerObserver(mForcastConditions);

        mWeatherDataSubject.setData(30, 150, 40);
        mWeatherDataSubject.removeObserver(mCurrentConditions);
        mWeatherDataSubject.setData(40, 250, 50);
    }

}
